package thread;

public class Yield {
    public static int aa ;
    public static boolean is ;

    public static void main(String[] args)throws Exception {
        new Thread(() -> {
            if (!Yield.is) {
                Thread.yield();
            }
            System.out.println(aa);
        }).start();
        Thread.sleep(1000);
        is = true;
        aa = 42;

    }
}
